package com.kolaxy.configclient;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <一句话功能描述><功能详细描述>
 *
 * @author zhourunjin
 * @version: [版本号，2018-09-07]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@RefreshScope
@RestController
public class TestController {

    @Value("${from}")
    private String from;

    @Autowired
    private Environment environment;

    @RequestMapping("from")
    public String from(){
        return environment.getProperty("from1","haha");
    }
}
